import LoadUi from "../../ui/load/LoadUi";

export default class ResMgr {
    public static insPrefab (prefabPath:string, cb:(node:cc.Node)=>void):void {
        LoadUi.instance.retain();
        cc.loader.loadRes(prefabPath, (err, prefab)=>{
            LoadUi.instance.release();
            if (!err) {
                cb(cc.instantiate(prefab));
            } else {
                console.error("load error", err);
            }
        });
    }
}
